#pragma once

#include <windows.h>
#include <d3d9.h>
#include "Singleton.h"

class Render : public Singleton<Render>
{
public:
	Render(void);
	~Render(void);

	bool Init(HWND hWnd);
	void Exit();

	inline LPDIRECT3DDEVICE9 getDevice() { return mD3DDevice; }

	LPDIRECT3DTEXTURE9 CreateTexture(int width, int height, D3DFORMAT format, bool depth);

	void BeginScene();
	void EndScene();

private:
	void DoRender();

	D3DCAPS9 mD3DCAPS;
	LPDIRECT3D9 mD3D;
	LPDIRECT3DDEVICE9 mD3DDevice;
	bool mUseNVPerfHUD;
	bool mVSync;
};
